import request from '@/utils/request'

export function getPage(query) {
  return request({
    url: '/web-api/base/equipment/listPage',
    method: 'get',
    params: query
  })
}

export function getList(query) {
  return request({
    url: '/web-api/base/equipment/list',
    method: 'get',
    params: query
  })
}

export function getById(id) {
  return request({
    url: '/web-api/base/equipment/' + id,
    method: 'get'
  })
}

export function add(data) {
  return request({
    url: '/web-api/base/equipment',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: '/web-api/base/equipment/' + ids,
    method: 'delete'
  })
}

export function edit(data) {
  return request({
    url: '/web-api/base/equipment',
    method: 'put',
    data
  })
}

export function download(query) {
  return request({
    url: '/web-api/base/equipment/export',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

export function statisticsEquipment(query) {
  return request({
    url: '/web-api/base/equipment/statisticsEquipment',
    method: 'get',
    params: query
  })
}

export function statisticsEquipmentDownload(query) {
  return request({
    url: '/web-api/base/equipment/statisticsEquipmentDownload',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
